#include <gvars3/instances.h>
#include <iostream>
#include <cstdlib>

using namespace GVars3;
using namespace std;

int main(int argc, char** argv)
{
    //Load a configuration file (optional)
    GUI.LoadFile("foo.cfg");

    //Process commandline arguments (optional)
    cout << "An integer = " << GV3::get<int>("wurble") << endl;
    cout << "A float = " << GV3::get<float>("fobble") << endl;

    //Make an easier to use binding to a gvar:
    gvar3<int> an_integer("i");

    //An illustration of using the graphical
    //components.
    while(1)
    {
        //Process the GUI. This can be done in another thread if
        //need be.
        GUI_Widgets.process_in_crnt_thread();

        cout << "\r" << *an_integer << "     " << flush;
        usleep(10000);
    }
}
